package com.chen.spike.mq;

import com.chen.spike.model.PostOrderResp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "order-resp-queue")
public class OrderListener {

    private static final Logger logger = LoggerFactory.getLogger(OrderListener.class);

    @RabbitHandler
    public void onMessage(@Payload PostOrderResp postOrderResp) {
        logger.info("receive : " + postOrderResp.toString());
    }

}
